﻿using Cheems.Interface.Models.UserManagement;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Cheems.Control.Converters
{
    public class UserLevelToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is UserLevel userLevel)
            {
                switch (userLevel)
                {
                    case UserLevel.None:
                        return "未知";
                    case UserLevel.Tourist:
                        return "游客";
                    case UserLevel.Operator:
                        return "操作员";
                    case UserLevel.Engineer:
                        return "工程师";
                    case UserLevel.Administrator:
                        return "管理员";
                    case UserLevel.SuperAdministrator:
                        return "超级管理员";
                    default:
                        return "未知";
                }
            }
            return "未知";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // 这里只需要转换前向，不需要反向转换
            throw new NotImplementedException();
        }
    }
}
